import 'package:flutter/material.dart';import '../change_notifier_provider.dart';// 这是一个便捷类，会获得当前context和指定数据类型的Providerclass CartConsumer<T> extends StatelessWidget {  const CartConsumer({    Key key,    @required this.builder,    this.child,  })  : assert(builder != null),        super(key: key);  final Widget child;  final Widget Function(BuildContext context, T value) builder;  @override  Widget build(BuildContext context) {    return builder(      context,      ChangeNotifierProvider.of<T>(context),    );  }}